import {Injectable} from "@angular/core";
import {HttpHelper} from "df_ng_mall_services";
@Injectable()
export class DeshunShopService{

    private dsUrl:string;
    constructor(private helper:HttpHelper){
        this.dsUrl = '/rest/deshun/';
    }

    getAward(spec,award) :Promise<any[]>{
        let url = this.dsUrl + `awards?spec=${spec}&award=${award}`;
        return this.helper.getJson(url);
    }

    setAward(spec,customParams):Promise<boolean>{
        let url = this.dsUrl + `init/award?spec=${spec}`;
        return this.helper.postToBoolean(url,customParams);
    }
}